<%@ page contentType="text/html;charset=utf-8" pageEncoding="utf-8" %>
<html>
<head>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script>
    <style type="text/css">
        #mydiv {
            position: absolute;
            left: 50%;
            top: 40%;
            margin-left: -200px;
            margin-top: -50px;
        }
    </style>
    <script type="text/javascript">
        $(document).ready(function(){
            $("#search").click(function () {
                var content = $("#id").val();
                $.ajax({
                    type: "get",
                    url: "/search/goo.do",
                    data: {"id": content},
                    contentType: "application/json",
                    success(data) {
                        if(data.name!=null){
                            $("#popdiv").html(data.name);
                        }else{
                            $("#popdiv").html("请检查此id是否存在") ;
                        }

                    }
                })
            })
        });
    </script>
</head>
<body>

<div id="mydiv">
    <input type="text" size="50" id="id"/>
    <input type="button" id="search" value="搜索" width="50px"/>
    <div id="popdiv">

    </div>
</div>
</body>
</html>
